import {
	axios
} from "./axios.js";


// 将 message-data 发送到后端存储
export const saveMessage = (data) => {
	return axios({
		url: '/message/saveMessage',
		method: 'post',
		data: data,
		headers: {
			token: uni.getStorageSync("token")
		}
	})
}

// 获取聊天列表
export const getAllUserMessageList = () => {
	return axios({
		url: '/chat-messages/getAllUserMessageList',
		method: 'get',
		headers: {
			token: uni.getStorageSync("token")
		}
	})
}

// 根据用户aid获取全部消息
export const getMessages = (param) => {
	return axios({
		url: '/chat-messages/getMessages',
		method: 'get',
		params: param,
		headers: {
			token: uni.getStorageSync("token")
		}
	})
}


// 发送文字消息给对方
export const sendMessageTo = (param) => {
	return axios({
		url: '/chat-messages/sendMessageTo',
		method: 'post',
		data: param,
		headers: {
			token: uni.getStorageSync("token")
		}
	})
}